/* eslint-disable no-unused-vars */
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

let store = new Vuex.Store({
  state: {
    dataSource: [],
    declareDetail: {}
  },

  getters: {
    getDataSource(state) {
      return state.dataSource
    },

    getDeclareDetail(state) {
      return state.declareDetail
    }
  },

  actions: {
    setDataSource({ commit, state }, data) {
      commit("setData", data)
    },

    setDeclare({ commit, state }, data) {
      commit('setDeclare', data)
    }
  },

  mutations: {
    setData(state, data) {
      state.dataSource = data
    },

    setDeclare(state, data) {
      state.declareDetail = data
    }
  }
});

export default store;